<?php
class mysql{

 protected $host = 'localhost';
 protected $data = '';
 protected $user = '';
 protected $pass = '';
 
 private $conn;
 private $result;
 
  function connect(){
    $this->conn = mysql_connect($this->host,$this->user,$this->pass);
    mysql_select_db($this->data, $this->conn);
  }
  
  function query($query){
    $query = str_replace("union","",$query);
    $this->result = mysql_query($query, $this->conn) or die(mysql_error());
    return $this->result;
  }
 
  function numrows(){
    if($this->result) {
     return mysql_num_rows($this->result);
     }
     return false;
  }
  
  function fetcharray(){
    if($this->result) {
			return mysql_fetch_array($this->result);
		}
		return false;
  }
  
  function close(){
    mysql_close();
  }
} 
?>